#被动技能【炼狱精灵守护】
effect give @a[tag=yifuer,scores={skSnowball=0}] minecraft:fire_resistance 1 0
execute at @a[tag=yifuer,scores={skSnowball=0}] rotated ~ 0 positioned ^1 ^2.2 ^-0.5 run particle flame ~ ~ ~ 0.1 0.1 0.1 0.01 1 normal @a
effect give @a[tag=yifuer,scores={skEXBottle=0}] minecraft:fire_resistance 1 0
execute at @a[tag=yifuer,scores={skEXBottle=0}] rotated ~ 0 positioned ^-1 ^2.2 ^-0.5 run particle flame ~ ~ ~ 0.1 0.1 0.1 0.01 1 normal @a

#【精灵火域】
execute as @a[tag=yifuer,scores={skEXBottle=1}] at @s run function nw:yingxiong/2yingxiong/04jingling/skill/1huoyu1
#【精灵A】
execute if entity @e[type=armor_stand,tag=jingling] as @a[tag=yifuer,scores={skEXBottle=3}] at @s run function nw:yingxiong/2yingxiong/04jingling/skill/1huoyu2
#【精灵】CD
execute as @a[tag=yifuer,scores={skCDEXBottle=0}] run function nw:yingxiong/2yingxiong/04jingling/skill/1huoyu_cd


#主动技能【去吧！精灵】改变雪球
execute at @a[tag=yifuer,scores={skSnowball=1}] as @e[type=minecraft:snowball,distance=0..5] run tag @s add jlSnowball
execute at @a[tag=yifuer,scores={skSnowball=1}] as @e[type=minecraft:snowball,distance=0..5] run data merge entity @s {NoGravity:1b}
#主动技能【去吧！精灵】
execute as @a[tag=yifuer,scores={skSnowball=1}] at @s run function nw:yingxiong/2yingxiong/04jingling/skill/2jingling1
#主动技能【去吧！精灵】二段：遇到敌人投放火球
execute as @e[type=minecraft:snowball,tag=jlSnowball] at @s as @p[distance=0..3,gamemode=!spectator,tag=!yifuer] at @s run function nw:yingxiong/2yingxiong/04jingling/skill/2jingling0
#主动技能【去吧！精灵】三段：【精灵的呼唤B】
execute if entity @e[type=minecraft:snowball,tag=jlSnowball] as @a[tag=yifuer,scores={skSnowball=3..}] at @s run function nw:yingxiong/2yingxiong/04jingling/skill/2jingling2
#主动技能【去吧！精灵】CD
execute as @a[tag=yifuer,scores={skCDPearl=0}] run function nw:yingxiong/2yingxiong/04jingling/skill/2jingling_cd
#主动技能【精灵】特效
execute as @e[type=snowball,tag=jlSnowball] at @s run particle flame ~ ~ ~ 0.2 0.2 0.2 0.05 2 normal @a


#【精灵效果&特效】
#自身效果
execute as @e[type=armor_stand,tag=jingling] at @s run effect give @a[distance=0..5,gamemode=!spectator,tag=yifuer] slow_falling 2 0 true
execute as @e[type=armor_stand,tag=jingling] at @s run effect give @a[distance=0..5,gamemode=!spectator,tag=yifuer] speed 2 0 true
#其他玩家效果
execute as @e[type=armor_stand,tag=jingling] at @s run effect give @a[distance=0..5,gamemode=!spectator,tag=!yifuer] minecraft:levitation 2 1 true
execute as @e[type=armor_stand,tag=jingling] at @s run effect give @a[distance=0..5,gamemode=!spectator,tag=!yifuer] minecraft:weakness 1 0 true
#特效
execute as @e[type=armor_stand,tag=jingling] at @s positioned ~ ~2 ~ run particle flame ~ ~ ~ 1.6 1.8 1.6 0.01 3 normal @a
execute as @e[type=armor_stand,tag=jingling] at @s positioned ~ ~-2 ~ run particle flame ~ ~ ~ 1.6 1.8 1.6 0.01 3 normal @a
#显示范围特效
execute as @e[type=armor_stand,tag=jingling] at @s run tp @s ~ ~ ~ ~7 ~
execute as @e[type=armor_stand,tag=jingling] at @s rotated ~ 0 positioned ^ ^0.2 ^5 run particle flame ~ ~ ~ 0.1 0.1 0.1 0.01 1 normal @a
execute as @e[type=armor_stand,tag=jingling] at @s run tp @s ~ ~ ~ ~7 ~
execute as @e[type=armor_stand,tag=jingling] at @s rotated ~ 0 positioned ^ ^0.2 ^5 run particle flame ~ ~ ~ 0.1 0.1 0.1 0.01 1 normal @a
execute as @e[type=armor_stand,tag=jingling] at @s run tp @s ~ ~ ~ ~7 ~
execute as @e[type=armor_stand,tag=jingling] at @s rotated ~ 0 positioned ^ ^0.2 ^5 run particle flame ~ ~ ~ 0.1 0.1 0.1 0.01 1 normal @a
execute as @e[type=armor_stand,tag=jingling] at @s run tp @s ~ ~ ~ ~7 ~
execute as @e[type=armor_stand,tag=jingling] at @s rotated ~ 0 positioned ^ ^0.2 ^5 run particle flame ~ ~ ~ 0.1 0.1 0.1 0.01 1 normal @a

kill @e[type=armor_stand,tag=jingling,scores={skCDEntity=7..}]
execute as @a[tag=yifuer] run title @s actionbar [{"text":"去吧！精灵","color":"dark_red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"正在冷却：","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"skCDPearl","name":"@s"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"s","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":" 精灵火域","color":"dark_red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"正在冷却：","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"skCDEXBottle","name":"@s"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"s","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]
